package io.modifier.basic.compose.theme

import androidx.compose.foundation.shape.CornerSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.unit.dp

interface AppConfig {

    val smallGap get() = 12.dp
    val gap get() = 16.dp
    val bigGap get() = 20.dp

    val radiusSmaller get() = 4.dp
    val radiusSmall get() = 8.dp
    val radius get() = 12.dp
    val radiusBig get() = 16.dp
    val radiusBigger get() = 20.dp

    val roundSmaller get() = RoundedCornerShape(radiusSmaller)
    val roundSmall get() = RoundedCornerShape(radiusSmall)
    val round get() = RoundedCornerShape(radius)
    val roundBig get() = RoundedCornerShape(radiusBig)
    val roundBigger get() = RoundedCornerShape(radiusBigger)

}

fun RoundedCornerShape.asTopPart():RoundedCornerShape = copy(bottomStart = CornerSize(0.dp), bottomEnd = CornerSize(0.dp))

fun RoundedCornerShape.asBottomPart():RoundedCornerShape  = copy(topStart = CornerSize(0.dp), topEnd = CornerSize(0.dp))

internal object DefaultAppConfig : AppConfig

val MaterialTheme.appConfig
    @Composable
    @ReadOnlyComposable
    get() = AppThemeHolder.config